<%@ page import="com.hua.entitiy.Login" %>
<%@ page import="com.hua.entitiy.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/11/16
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Title</title>
    <!-- <link type="text/css" rel="stylesheet" href="test3.css" />-->
    <!--<script type="text/javascript" src="<c:url value="/js/jquery-1.5.1.js" />">
    </script>-->

</head>
<body>
    <div>
        ${applicationScope.loginName}
        <br>
            <%--<%
                Object obj=session.getAttribute("loginTo");
                if(obj!=null&& obj instanceof User){
                    User user=(User)obj;
                    request.setAttribute("userName",user.getUserNmae());
                    request.setAttribute("userPwd",user.getUserPwd());
                }
            %>--%>
        <c:choose>
            <c:when test="${param.userName==applicationScope.loginName && param.userPwd==applicationScope.loginPwd }">
                <span>login success</span><a href="login.jsp">返回登录</a><a href="userMessage.jsp">查看我的信息</a>
                <%
                    session.setAttribute("loginTo",new User(request.getParameter("userName"),request.getParameter("userPwd")));
                    session.setMaxInactiveInterval(300);
                %>
            </c:when>
            <c:otherwise>
                <span>login error</span><a href="login.jsp">返回登录</a>
            </c:otherwise>
        </c:choose>
    </div>
</body>
</html>
